﻿using System;
using System.ServiceModel;

namespace ZMHWcfServiceLibrary
{
    public enum EventType
    {
        Event1 = 1,
        Event2 = 2,
        Event3 = 4,
        AllEvents = Event1 | Event2 | Event3
    }
    public interface IPublisherAndSubscriberCallback
    {
        [OperationContract(IsOneWay = true)]
        void OnEvent1();
        [OperationContract(IsOneWay = true)]
        void OnEvent2(int number);
        [OperationContract(IsOneWay = true)]
        void OnEvent3(int number, string text);
    }
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码和配置文件中的接口名“IPublisherAndSubscriber”。
    [ServiceContract(CallbackContract = typeof(IPublisherAndSubscriberCallback))]
    public interface IPublisherAndSubscriber
    {
        [OperationContract]
        void DoSomething();
        [OperationContract]
        void Subscribe(EventType mask);
        [OperationContract]
        void Unsubscribe(EventType mask);
    } 
}
